{extend name='common/common' /}

{block name='style'}
<style media="screen">
.treeBox {
	padding: 15px;
	width: 520px;
	border: 1px solid #dcdfe6;
	border-radius:4px;
}
.Mask{
	position: absolute;
	z-index: 99999;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}
#remarkCt{
	width: 550px;
	border: 1px solid #dcdfe6;
	border-radius: 4px;
	overflow-x: auto;
	padding: 15px;
}
</style>
{/block}

{block name="component"}
<div id="FormBox">
<el-dialog :title="FormTitle" :visible.sync="showForm" fullscreen>
	<div class="FormBox">
		<el-form
			label-width="130px" :model="form" inline="true"
			ref="form" class="curForm">
			<el-form-item label="县登录编码">
				<el-input v-model="form.user_name" readonly clearable></el-input>
			</el-form-item>
			<el-form-item label="所属地区">
				<el-input v-model="form.depart_name" readonly clearable></el-input>
			</el-form-item><br>
			<el-form-item label="地区等级">
				<el-select v-model="form.level" disabled>
					<el-option label="村级" value="1"></el-option>
					<el-option label="镇级" value="2"></el-option>
					<el-option label="县级" value="3"></el-option>
					<el-option label="州级" value="4"></el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="地图描点">
				<el-input v-model="form.lnglat" readonly clearable></el-input>
			</el-form-item><br>
			<el-form-item label="地址信息">
				<el-input v-model="form.address" readonly type="textarea" style="width:580px;"></el-input>
			</el-form-item><br>
			<el-form-item label="运营公司">
				<el-input v-model="form.run_company" readonly clearable></el-input>
			</el-form-item>
			<el-form-item label="运营地址">
				<el-input v-model="form.run_address" readonly clearable></el-input>
			</el-form-item><br>
			<el-form-item label="运营网址">
				<el-input v-model="form.website" readonly clearable></el-input>
			</el-form-item>
			<el-form-item label="电话">
				<el-input v-model="form.link_type" readonly clearable></el-input>
			</el-form-item><br>
			<el-form-item label="运营中心介绍">
				<div v-html="form.remark" id="remarkCt"></div>
			</el-form-item><br>
		</el-form>
	</div>
	<div slot="footer" class="dialog-footer">
		<el-button plain type="info" @click="showForm = false">取消审核</el-button>
		<el-button plain type="danger" @click="subForm(0)">审核不过</el-button>
		<el-button plain type="success" @click="subForm(1)">审核通过</el-button>
	</div>
</el-dialog>
</div>
<script type="text/javascript">
var FormBox = new Vue({
	el:"#FormBox",
	data:{
		FormTitle:"审核注册信息",
		showForm:false,
		form:"",
		goodsCateData:"",
		props:{
			label:"name",
		},
		buy:[],
		sell:[]
	},
	methods:{
		subForm(state) {
			var param = {
				state:state,
				row_id:this.form.id,
				uid:this.form.uid,
				level:this.form.level,
			}
			$.post("./exGovernment",param,function(res){
				if(res.code == 1){
					main.$notify({title:"成功",type:"success",message:res.msg});
				}else{
					main.$notify.error({title:"错误",message:res.msg});
				}
				main.getTable();
			});
			this.showForm = false;
		}
	}
});
</script>
{/block}

{block name="content"}
<el-card class="box-card">
	<div slot="header">
		<span class="span-primary"><i class="fa fa-list"></i></span>
		县级注册列表
	</div>
	<el-table :data="tableData" border>
		<el-table-column align="center" prop="id" label="序号" width="50"></el-table-column>
		<el-table-column align="center" label="所属地区" prop="depart_name"></el-table-column>
		<el-table-column align="center" label="电话" prop="link_type"></el-table-column>
		<el-table-column align="center" label="运营公司" prop="run_company"></el-table-column>
		<el-table-column align="center" label="网站" prop="website"></el-table-column>
		<el-table-column align="center" label="注册状态">
			<template slot-scope="scope">
				<el-tag
					:type="scope.row.register_status == '4' ? 'success' : 'info'">
					{{scope.row.register_status_name}}
				</el-tag>
      		</template>
		</el-table-column>
		<el-table-column align="center" label="审核">
			<template slot-scope="scope">
				{if authCheck('users/examine')}
				<el-tooltip content="审核" open-delay="500" hide-after="1500" placement="right">
					<el-button
						@click="examineRow(scope.row)" circle
						size="mini" plain type="primary"
						icon="el-icon-success">
					</el-button>
				</el-tooltip>
				{/if}
			</template>
		</el-table-column>
	</el-table>
	<div class="table-page">
		<el-pagination
			@size-change="pageSizeChange"
			@current-change="curPageChange"
			:current-page="pageNumber"
			:page-sizes="[10, 20, 50, 75]"
			:page-size="pageSize"
			layout="total, sizes, prev, pager, next, jumper"
			:total="tableTotal">
		</el-pagination>
	</div>
</el-card>
{/block}

{block name="script"}
<script type="text/javascript">
var main = new Vue({
	el:"#main",
	data:{
		loading:false,
		tableData:"",
		pageSize:10,
		pageNumber:1,
		tableTotal:0,
	},
	mounted:function() {
		this.getTable();
	},
	methods:{
		getTable() {
			this.loading=true;
			var param = {
				pageSize:this.pageSize,
				pageNumber:this.pageNumber,
			};
			$.post('./CountyList',param,function(res){
				main.loading=false;
				if(res.code == 1){
					main.$message({message: res.msg,type: 'success'});
					main.tableData = res.data.rows;
					main.tableTotal = res.data.total;
				}else{
					main.$notify.error({title: '失败',message: res.msg});
				}
			});
		},
		pageSizeChange(val) {
			this.pageSize = val;
			this.getTable();
		},
		curPageChange(val) {
			this.pageNumber = val;
			this.getTable();
		},
		examineRow(row) {
			FormBox.showForm = true;
			FormBox.form = row;
		}
	}
})
</script>
{/block}
